
public class Judge implements Runnable{
	Map panel;
	Destroy judge;
	Score sc = new Score();

	private boolean runflg = true;
	private boolean lineflg = false;

	Judge(Map m){
		panel = m;
	}

	public void run(){
		while(runflg){
			try {
				judge = new Destroy(panel);
				while(judge.isExistance() == true){
					destroy(judge.getDestroyBlock());
					lineflg = true;
				}
				if(lineflg == true){
					sc.addScore();
					lineflg = false;
				}
				panel.stop(100);
			} catch (Exception e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
		}
	}
	public void fin(){
		runflg = false;
	}

	public void destroy(DestroyBlock block){
		panel.map[block.getDestroyLoation_y()][block.getDestroyLoation_x()] = 7;
	}
}

